import React from 'react';
import {Switch, Route} from 'react-router-dom';
import CrudModal from 'pages/datasource/components/CrudModal';
import {ENUM_OPERATION} from 'shared/utils/enumerate';

/* eslint-disable */
const routes = ({match}) =>
  <Switch>
    <Route exact path={`${match.path}/create`} render={
      props => <CrudModal
        {...props}
        operation={ENUM_OPERATION.CREATE}
        title="新建数据源"
      />
    }/>
    <Route exact path={`${match.path}/modify/:id`} render={
      props => <CrudModal
        {...props}
        operation={ENUM_OPERATION.MODIFY}
        title="编辑数据源"
      />
    }/>
  </Switch>;

export default routes;
